{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#tab_basic">接口设置</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form">
			<div class="panel panel-default">
				<div class="panel-heading">接口设置</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-2 control-label">接口Token</label>
						<div class="col-sm-9">
							<div class="input-group">
								<input type="text" name="apitoken" class="form-control" id="num" value="{$settings['token']}">
								<a href="javascript:;" class="input-group-addon">生成新的Token</a>
							</div>
							<div class="help-block">请不要随意变更接口Token，否则将导致接口无法调用</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label"></label>
						<div class="col-sm-9">
							<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
							<input type="hidden" name="token" value="{$_W['token']}" />
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$(document).on('click', '.input-group-addon', function() {
		tip.confirm('旧Token将失效，确认生成新的Token？', getNum);
		function getNum(){
			var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
			var nums="";
			for(var i=0;i<32;i++){
				var id = parseInt(Math.random()*61);
				nums+=chars[id];
			}
			$('#num').val(nums);
		}
	});
</script>
{php include wl_template('common/footer');}